﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace Admin_jiaju.Core.Models
{
    public class Student
    {
        public int Id { get; set; }
        [Display(Name = "名字")]
        [Required(ErrorMessage = "请输入名字他不能为空")]
        [StringLength(50)]
        public string StudentName { get; set; }
        [Display(Name = "性别")]
        [Required(ErrorMessage = "请输入性别，它不能为空")]
        public bool Gender { get; set; }
        [Display(Name = "手机号")]
       [RegularExpression(@"^[1]+[3,5]+\d{9}",ErrorMessage = "手机号格式不正确")]
        [Required(ErrorMessage = "请输入手机号，它不能为空")]
        public string Phone { get; set; }
        [Display(Name = "地址")]
        [Required(ErrorMessage = "请输入地址，它不能为空")]
        public string Address { get; set; }
        [Required]
        public int StuClassId { get; set; }
        public virtual StuClass StuClass { get; set; }
        
    }
}
